import React from "react";
import storage from "stora";

//_key前缀
const _appkey = 'canteenpay_';
//实现浏览器缓存
var localCache = {

    //设置缓存
    set(key, value) {
        storage.set(_appkey + key, value);
    },
    //获取缓存
    get(key) {
        return storage.get(_appkey + key) || {};
    },
    //删除缓存
    remove(key) {
        storage.remove(_appkey + key);
    }
}

export default localCache